/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package it.polimi.games.epkb.entityClasses;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author plebani
 */
@Embeddable
public class ActivityDataPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "Id_Activity")
    private String idActivity;
    @Basic(optional = false)
    @Column(name = "Id_DataFile")
    private String idDataFile;

    public ActivityDataPK() {
    }

    public ActivityDataPK(String idActivity, String idDataFile) {
        this.idActivity = idActivity;
        this.idDataFile = idDataFile;
    }

    public String getIdActivity() {
        return idActivity;
    }

    public void setIdActivity(String idActivity) {
        this.idActivity = idActivity;
    }

    public String getIdDataFile() {
        return idDataFile;
    }

    public void setIdDataFile(String idDataFile) {
        this.idDataFile = idDataFile;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idActivity != null ? idActivity.hashCode() : 0);
        hash += (idDataFile != null ? idDataFile.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ActivityDataPK)) {
            return false;
        }
        ActivityDataPK other = (ActivityDataPK) object;
        if ((this.idActivity == null && other.idActivity != null) || (this.idActivity != null && !this.idActivity.equals(other.idActivity))) {
            return false;
        }
        if ((this.idDataFile == null && other.idDataFile != null) || (this.idDataFile != null && !this.idDataFile.equals(other.idDataFile))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "it.polimi.games.epkb.entityClasses.ActivityDataPK[ idActivity=" + idActivity + ", idDataFile=" + idDataFile + " ]";
    }
    
}
